import request from '@/utils/request'

// 获取用户详细信息
export function getUserInfo() {
    return request({
        url: '/dzq/user/get-info',
        method: 'GET'
    })
}

// 获取用户实名认证信息
export function getUserVerification() {
    return request({
        url: '/dzq/user/get-verification',
        method: 'GET'
    })
}

// 用户实名认证
export function verifyUser(data) {
    return request({
        url: '/dzq/user/set-verification',
        method: 'POST',
        data: data
    })
}

// 更新用户信息
export function updateUserInfo(data) {
    return request({
        url: '/dzq/user/update-info',
        method: 'POST',
        data: data
    })
}

// 更新用户密码
export function updateUserPassword(data) {
    return request({
        url: '/dzq/user/update-password',
        method: 'POST',
        data: data
    })
}

// 更新用户头像
export function updateUserAvatar(data) {
    return request({
        url: '/dzq/user/update-info-avatar',
        method: 'POST',
        data: data
    })
}

// 刷新token
export function refreshToken(params) {
    return request({
        url: '/dzq/auth/refresh-token',
        method: 'POST',
        params: params
    })
}

// 欠条原因信息
export function getLoanReason(params) {
    return request({
        url: '/dzq/loan-reason/get-loan-reason',
        method: 'GET',
        params: params
    })
}

// 获取内容配置
export function getContentConfig(params) {
    return request({
        url: '/dzq/content-config/get-content-config',
        method: 'GET',
        params: params
    })
}

// 获取往来列表
export function getContractList(params) {
    return request({
        url: '/dzq/contract/get-coming-going',
        method: 'GET',
        params: params
    })
}

// 创建合同
export function createContract(params) {
    return request({
        url: '/dzq/contract/create-contract',
        method: 'POST',
        data: params
    })
}

// 合同签名
export function signatureSign(data) {
    return request({
        url: '/dzq/signature/sign',
        method: 'POST',
        data: data
    })
}

// 获取合同列表
export function getSignContractList(data) {
    return request({
        url: '/dzq/contract/get-sign-contract-list',
        method: 'POST',
        data: data
    })
}

// 创建支付订单
export function createPayOrder(data) {
    return request({
        url: '/dzq/pay/submit',
        method: 'POST',
        data: data
    })
}

// 获取支付订单
export function getPayOrder(data) {
    return request({
        url: '/pay/order/get',
        method: 'POST',
        data: data
    })
}


export function socialLogin(data) {
    return request({
        url: '/dzq/auth/social-login',
        method: 'POST',
        data: data
    })
}

export function socialAuthRedirect(params) {
    return request({
        url: '/dzq/auth/social-auth-redirect',
        method: 'GET',
        params: params
    })
}


export function getSocialLogin(data) {
    return request({
        url: '/dzq/auth/social-login',
        method: 'POST',
        data: data
    })
}

// 创建微信jsapi签名
export function createWeixinJsapiSignature(params) {
    return request({
        url: '/dzq/pay/create-weixin-jsapi-signature',
        method: 'POST',
        params: params
    })
}

// 获取合同详情
export function getContractDetails(params) {
    return request({
        url: '/dzq/contract/get-contract-details',
        method: 'GET',
        params: params
    })
}

// 获取协议类型
export function getAgreementType(params) {
    return request({
        url: '/dzq/agreement/get-Agreement-type',
        method: 'GET',
        params: params
    })
}

// 取消合同
export function cancelContract(params) {
    return request({
        url: '/dzq/contract/contract-cancellation-note',
        method: 'GET',
        params: params
    })
}